package com.goldcn.user.controller;

import com.goldcn.user.model.UserApply;
import com.goldcn.user.service.UserTransferService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by 1111 on 2016/11/10.
 */
@Api(value = "用户部门调动申请")
@RestController
@RequestMapping(value = "/userTransfers")
public class UserTransferController {
    @Autowired
    UserTransferService userTransferService;

    @ApiOperation(value = "员工部门调度申请")
    @RequestMapping(method = RequestMethod.POST)
    public Object updateUserInfo(@RequestBody UserApply userApply) {
        return userTransferService.insertSelective(userApply);
    }


    @ApiOperation(value = "员工搜索_部门管理者候选人")
    @RequestMapping(value = "/employees",method = RequestMethod.POST)
    public Object getEmployee(@RequestBody Map<String,Object> map) {
        return userTransferService.selectEmployee(MapUtils.getString(map,"keyword"));
    }


}
